<template>
  <div class="person">
    <h1>中国</h1>
    <h2 ref="shenzhen">深圳</h2>
    <button @click="outputRefContent">点击输出ref标记的内容</button>
  </div>
</template>

<script lang="ts" setup>
import { ref, defineExpose } from 'vue'

const a = ref(0)
const b = ref(1)
const c = ref(2)

const shenzhen = ref()

function outputRefContent() {
  console.log(shenzhen.value);
}

defineExpose({ b, c })
</script>

<style scoped>
.person {
  background: darksalmon;
  box-shadow: 0 0 10px;
  border-radius: 10px;
  padding: 20px;
}
</style>